<!DOCTYPE html>
{% load staticfiles %}
<html>
<head>
	<meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" >
	<title>慕学在线网登录</title>
	<link rel="stylesheet" type="text/css" href="/static/css/reset.css">
	<link rel="stylesheet" type="text/css" href="{% static '/css/login.css' %}">
    <script src="/static/js/jquery.min.js" type="text/javascript"></script>
    <script src="/static/js/unslider.js" type="text/javascript"></script>
    <script src="/static/js/login.js"  type="text/javascript"></script>
    <script src="/static/js/util/myUtil.js"  type="text/javascript"></script>
    <script>
    function checkFields(){
        return true
        var account_l = $("#account_l").val()//邮箱，手机号码，用户名三种类型
        var password_l = $("#password_l").val()
        if($.lixing.checkAccount(account_l)){
            $("#account_l").parents().removeClass("errorput")
        }else{
            if($.lixing.checkMobilePhone(account_l)){
                $("#account_l").parents().removeClass("errorput")
            }else{
                if ($.lixing.checkEmail(account_l)){
                    $("#account_l").parents().removeClass("errorput")
                }else{
                    alert("用户名格式输入不正确!")
                    $("#account_l").parents().addClass("errorput")
                    return false
                }
            }
        }
        if($.lixing.checkPassword(password_l)){
            $("#account_l").parents().removeClass("errorput")
        }else{
            alert("密码格式输入不正确!")
            $("#password_l").parents().addClass("errorput")
            return false
        }
        return true
    }
    </script>
</head>
<body>
<header>
    <div class="c-box fff-box">
        <div class="wp header-box">
            <p class="fl hd-tips">慕学在线网，在线学习平台！</p>
            <ul class="fr hd-bar">
                <li>服务电话：<span>88888888</span></li>
                <li class="active"><a href="{% url 'users:login' %}">[登录]</a></li>
                <li><a href="{% url 'users:register' %}">[注册]</a></li>
            </ul>
        </div>
    </div>
</header>
<section>
    <div class="c-box bg-box">
        <div class="login-box clearfix">
            <div class="hd-login clearfix">
                <a class="index-logo" href="{% url 'index' %}"></a>
                <h1>用户登录</h1>
                <a class="index-font" href="{% url 'index' %}">回到首页</a>
            </div>
            <div class="fl slide">
                <div class="imgslide">
                    <ul class="imgs">
                        <li><a href=""><img width="483" height="472" src="/static/images/mysql.jpg" /></a></li>
                        <li><a href=""><img width="483" height="472" src="/static/images/mysql.jpg" /></a></li>
                        <li><a href=""><img width="483" height="472" src="/static/images/mysql.jpg" /></a></li>
                    </ul>
                </div>
                <div class="unslider-arrow prev"></div>
                <div class="unslider-arrow next"></div>
            </div>
            <div class="fl form-box">
                <h2>帐号登录 admin li1234mx</h2>
                <form action="{% url "users:login" %}" onsubmit="return checkFields()" method="post" autocomplete="off">
                {% csrf_token %}
                    <div class="form-group marb20 {% if loginForm.errors.username %}errorput{% endif %}">
                        <label>用&nbsp;户&nbsp;名</label>
                        <input style="width:194px" name="username" id="account_l" type="text" placeholder="邮箱/手机号/用户名"/>
                    </div>
                    <div class="form-group marb8 {% if loginForm.errors.password %}errorput{% endif %}">
                        <label>密&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;码</label>
                        <input style="width:194px" name="password" id="password_l" type="password" placeholder="请输入您的密码"/>
                    </div>
                    <div class="error btns login-form-tips" id="jsLoginTips">
                        {{ msg }}
                        {% for key,error in loginForm.errors.items %}
                        {{ error }}
                        {% endfor %}
                    </div>
                    <div class="auto-box marb38">
                        <a class="fr" href="{% url 'users:passwordForget' %}">忘记密码？</a>
                    </div>
                    <input class="btn btn-green" id="jsLoginBtn" type="submit" value="立即登录"/>
                </form>
                <p class="form-p">没有慕学在线网帐号？<a href="{% url 'users:register' %}">[立即注册]</a></p>
            </div>
        </div>
    </div>
</section>
</body>
</html>
